package com.core.services;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.domain.PageRequest;
import org.springframework.data.domain.Pageable;
import org.springframework.data.domain.Sort;
import org.springframework.data.domain.Sort.Direction;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import com.core.repositories.ImgRepository;

@Service
@Transactional
public class ImgService {
	
	@Autowired
	ImgRepository repository;
	
	public void findByPage(){
		Sort sort = new Sort(Direction.DESC, "sku");
		Pageable pa =  new PageRequest(0, 10, sort); 
		System.out.println( repository.findAll(pa).getSize());;
	}
}
